<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>文件管理系统</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='assets/layui/css/layui.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/file-mapper/download.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/file-mapper/tree-styles.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/file-mapper/detail-styles.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/file-mapper/drawer.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/file-mapper/main-styles.css') }}">

</head>
<body>
    <div class="main-container">
        <!-- 顶部导航栏 -->
        <div class="header-nav">
            <ul class="layui-nav layui-bg-cyan">
                <li class="layui-nav-item">
                    <a href="javascript:;" data-page="home">首页</a>
                </li>
                <li class="layui-nav-item layui-this">
                    <a href="javascript:;" data-page="file-manager">文件管理</a>
                </li>
                <li class="layui-nav-item layui-this">
                    <a href="javascript:;" data-page="control-tool">控车工具</a>
                </li>
                <li class="layui-nav-item layui-this">
                    <a href="javascript:;" data-page="validator-config">验证配置</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" data-page="settings">设置</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" data-page="about">关于</a>
                </li>
                
                <li class="layui-nav-item layui-layout-right">
                    <a href="javascript:;" id="drawerBtn">
                        <i class="layui-icon layui-icon-menu-fill"></i> 管理面板
                    </a>
                </li>
            </ul>
        </div>
        

        <!-- 状态显示 -->
        <div class="status-bar">
            <span class="currentStatus info" id="currentStatus">就绪</span>
        </div>
        
        <!-- 主要内容区域 -->
        <div class="content-wrapper">
            <!-- 左侧面板：文件夹目录树 -->
            <div class="left-panel">
                <div class="folder-tree-container">

                    <div class="contain-header">
                        <div class="file-path">
                            <span id="treeCurrentPath" class="path-text">/home</span>
                        </div>
                        <button class="layui-btn layui-btn-xs" id="refreshTreeBtn">
                            <i class="layui-icon layui-icon-refresh"></i> 刷新
                        </button>
                    </div>
                    <!-- 目录树容器 -->
                    <div class="tree-wrapper">
                        <div id="loading-tree" class="loading" style="display: none;">
                            <i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>
                            <span>加载中...</span>
                        </div>
                        <ul id="directoryTree"></ul>
                    </div>
                </div>
            </div>
            
            <!-- 中间面板：文件详情界面 -->
            <div class="middle-panel">
                <div class="file-details-container">
                    <div class="contain-header">
                        <div class="file-path">
                            <span id="detailCurrentPath" class="path-text">/home</span>
                        </div>
                        <button class="layui-btn layui-btn-xs" id="refreshDetailBtn">
                            <i class="layui-icon layui-icon-refresh"></i> 刷新
                        </button>
                    </div>
                    <div class="details-content">
                        <div id="loading-detail" class="loading" style="display: none;">
                            <i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>
                            <span>加载中...</span>
                        </div>
                        <div class="file-info">
                            <table class="layui-hide" id="fileTable" lay-filter="fileTable"></table>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 右侧面板：代码编辑器 -->
            <div class="right-panel">
                <div class="contain-header">
                    <div class="file-path">
                        <span id="editorCurrentPath" class="path-text">/home</span>
                    </div>
                    <div class="editor-actions">
                        <button class="layui-btn layui-btn-xs" id="saveFileBtn">
                            <i class="layui-icon layui-icon-ok"></i> 保存
                        </button>
                    </div>
                </div>
                <div class="code-editor-container">
                    <div class="code-editor-content">
                        <div id="loading-editor" class="loading" style="display: none;">
                            <i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>
                            <span>加载中...</span>
                        </div>
                        <textarea class="layui-textarea" id="codeEditor" placeholder="选择文件开始编辑..." style="height: 100%; resize: none; border: none; outline: none; font-family: 'Courier New', monospace;"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>

    
    <!-- 右键菜单 -->
    <div id="contextMenu" class="context-menu">
        <div class="context-menu-item" data-action="open">
            <i class="layui-icon layui-icon-ok-circle"></i>
            打开
        </div>
        <div class="context-menu-separator"></div>
        <div class="context-menu-item" data-action="rename">
            <i class="layui-icon layui-icon-edit"></i>
            重命名
        </div>
        <div class="context-menu-item" data-action="copy">
            <i class="layui-icon layui-icon-file"></i>
            复制
        </div>
        <div class="context-menu-item" data-action="move">
            <i class="layui-icon layui-icon-export"></i>
            剪切
        </div>
        <div class="context-menu-item layui-btn-disabled" id="pasteBtn" data-action="paste">
            <i class="layui-icon layui-icon-list"></i>
            粘贴
        </div>
        <div class="context-menu-separator"></div>
        <div class="context-menu-item" data-action="delete">
            <i class="layui-icon layui-icon-delete"></i>
            删除
        </div>
        <div class="context-menu-separator"></div>
        <div class="context-menu-item" data-action="permissions">
            <i class="layui-icon layui-icon-set"></i>
            修改权限
        </div>
        <div class="context-menu-item" data-action="tar">
            <i class="layui-icon layui-icon-heart"></i>
            压缩
        </div>
    </div>


    <!-- 引入模块化JS文件 -->
    <script src="{{ url_for('static', filename='assets/layui/layui.js') }}"></script>
    <script src="{{ url_for('static', filename='assets/js/socket.io/socket.io.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/socket.io/socket-client.js') }}"></script>
    
    <!-- <script src="{{ url_for('static', filename='js/file-mapper-logic/download.js') }}"></script> -->
    <script src="{{ url_for('static', filename='js/file-mapper-logic/loads.js') }}"></script>

    <script src="{{ url_for('static', filename='js/file-mapper-logic/tree-manager.js') }}"></script>
    <script src="{{ url_for('static', filename='js/file-mapper-logic/detail-manager.js') }}"></script>
    <script src="{{ url_for('static', filename='js/file-mapper-logic/editor-manager.js') }}"></script>
    <script src="{{ url_for('static', filename='js/file-mapper-logic/drawer-manager.js') }}"></script>
    <script src="{{ url_for('static', filename='js/file-mapper-logic/integration.js') }}"></script>
</body>
</html>